<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <title>上传</title>
	<script type="text/javascript">
		function sub(){
			var score = $('#score').val();
			var flag = true;
			if(score < 1 || score > 100000000){
				$('#score_err').text('分数不符合规范!');
				flag = false;
			}
			if(flag){
				$.ajax({
				   url: '/upload/',
				   data: {'score' : score},
				   type: 'POST',
				   success: function(result){
					  alert(result.status)
				   }
				})
			}
			return flag;
		}
	</script>
</head>
<body>
<form method="post">
    <h3>
		当前客户端{{user}}, 请上传分数: <input type="text" id="score" name="score" placeholder="0~1000000">
		&nbsp;&nbsp;&nbsp;&nbsp;
		<input name="" type="button" value="提交" onclick="return sub()"/>
		<div id="score_err", style="color: red;"></div>
	</h3>
</form>
&nbsp;&nbsp;
<a href="{% url 'demo1:show' %}"><input name="" type="button" value="查询"></a>
&nbsp;&nbsp;
<a href="/logout/"><input name="" type="button" value="退出"></a>

<script src="https://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>









</body>